package com.dqhl.community.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.dqhl.community.R;
import com.dqhl.community.base.BaseActivity;
import com.dqhl.community.view.MyLetterView;

/**
 * Created by guanluocang on 2016/9/02.
 * LocationActivity
 * 定位Activity
 */
public class LocationActivity extends BaseActivity implements View.OnClickListener, MyLetterView.OnTouchLetterListener {

    private ImageView iv_topBack;
    private TextView tv_topTitle;
    private TextView mTvTest;
    private MyLetterView letterView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_location);
        //实例化数据
        initView();
    }

    private void initView() {
        tv_topTitle = (TextView) findViewById(R.id.tv_top_title);
        letterView=(MyLetterView) findViewById(R.id.letterview);
        mTvTest=(TextView) findViewById(R.id.tv_test);
        tv_topTitle.setText(R.string.location_city);
        iv_topBack = (ImageView) findViewById(R.id.iv_top_back);
        iv_topBack.setVisibility(View.VISIBLE);
        letterView.setOnTouchLetterListener(this);
        iv_topBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.iv_top_back:
                finish();
                break;
        }
    }

    @Override
    public void onTouchLetter(String letter) {
        mTvTest.setText(letter);
    }
}
